//
// See the file COPYING for redistribution information.
//

#ifndef __NAIPAX_COMMON_HPP__
#define __NAIPAX_COMMON_HPP__

#define NAIPAX_PERROR(m)                                                \
    cerr << "Error: " << m                                              \
    << " at line " << __LINE__                                          \
    << " of file " << __FILE__ << endl

/// Throw error instance
#define NAIPAX_THROW(c)  throw Naipax::Error((c), __LINE__, __FILE__)

#include <stdint.h>

namespace Naipax {
    static const uint32_t FILENAME_SIZE        = 512;
    static const uint32_t PATHNAME_SIZE        = 256;
    static const uint32_t HOSTNAME_SIZE        = 128;

    static const uint32_t HTTP_REQUEST_HEADERS_SIZE  = 2048;
    static const uint32_t HTTP_RESPONSE_HEADERS_SIZE = 2048;
    static const uint32_t HTTP_RESPONSE_SIZE         = 4194304;
    
    static const uint32_t URL_SCHEME_SIZE      = 6;
    static const uint32_t URL_HOST_SIZE        = 128;
    static const uint32_t URL_PATH_SIZE        = 128;
    static const uint32_t URL_SIZE = (URL_SCHEME_SIZE - 1)
        + (URL_HOST_SIZE - 1) + (URL_PATH_SIZE - 1) + 1;
};

#endif // __NAIPAX_COMMON_HPP__
